<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="/WEB-INF/tags/functions.tld" %>
<%@ taglib prefix="t" uri="/WEB-INF/tags/tags.tld" %>
<link rel="stylesheet" href="/css/table.css" type="text/css" media="all" />
<link rel="stylesheet" href="/css/paging.css" type="text/css" media="all" />
<link rel="stylesheet" href="/css/message.css" type="text/css" media="all" />

<h2 style="margin-left: 2%;">Danh sách lớp học đang dạy</h2>
<hr size="1" />

<c:if test="${classes == null or empty classes}">
	<b>Không có lớp học nào đang dạy</b>
</c:if>
<c:if test="${classes != null and !empty classes}">
	<table>
		<thead>
			<tr>
				<th class="th">STT</th>
				<th class="th">Mã lớp</th>	
				<th class="th">Tên lớp</th>
				<th class="th">Học phần</th>
			</tr>	
		</thead>
		<tbody>
		<c:forEach items="${classes}" var="c" varStatus="status">
			<tr>
				<td class="td"><c:out value="${(pageInfo.currentPage - 1) * pageSize + status.count}" escapeXml="true" /></td>
				<td class="td"><a href="/lecturer/listStudentsInClass.html?key=${f:keyToString(c.classKey)}"><c:out value="${c.classId}" escapeXml="true" /></a></td>
				<td class="td"><c:out value="${c.className}" escapeXml="true" /></td>
				<td class="td"><c:out value="${c.subject.subjectId}" escapeXml="true" /></td>
			</tr>
		</c:forEach>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="4">
					<div class="pages">
						<t:paging pageInfo="${pageInfo}" link="/lecturer/listTeachClasses.html"/>
					</div>
				</td>
			</tr>
		</tfoot>
	</table>
</c:if>